package vista;
import java.awt.BorderLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;


import controlador.ContListadoIngredientes;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class DlgListadoIngredientes extends javax.swing.JDialog {
	private JPanel pnlListadoIngredientes;
	private JScrollPane jScrollPane1;
	private ButtonGroup buttonGroup1;
	private JTable tblIngredientes;
	private JRadioButton rbDescendente;
	private JButton btSalir;
	private JRadioButton rbAscendente;
	private JLabel lblOrdenar;

	private ContListadoIngredientes controlador;

	public DlgListadoIngredientes(JFrame frame, ContListadoIngredientes controlador) {
		super(frame);
		this.controlador = controlador;
		initGUI();
	}
	
	private void initGUI() {
		try {
			{
				this.setTitle("Listado de Ingredientes Mas Usados");
				{
					ButtonGroup grp = new ButtonGroup();
					
					pnlListadoIngredientes = new JPanel();
					getContentPane().add(pnlListadoIngredientes, BorderLayout.CENTER);
					pnlListadoIngredientes.setPreferredSize(new java.awt.Dimension(439, 319));
					pnlListadoIngredientes.setLayout(null);
					{
						lblOrdenar = new JLabel();
						pnlListadoIngredientes.add(lblOrdenar);
						lblOrdenar.setText("Ordenar:");
						lblOrdenar.setBounds(35, 19, 70, 14);
					}
					{
						rbAscendente = new JRadioButton();
						pnlListadoIngredientes.add(rbAscendente);
						rbAscendente.setText("Ascendentemente");
						rbAscendente.setBounds(117, 17, 167, 18);
						grp.add(rbAscendente);
					}
					{
						rbDescendente = new JRadioButton();
						pnlListadoIngredientes.add(rbDescendente);
						rbDescendente.setText("Descendentemente");
						rbDescendente.setBounds(117, 42, 167, 18);
						grp.add(rbDescendente);
					}
					{
						jScrollPane1 = new JScrollPane();
						pnlListadoIngredientes.add(jScrollPane1);
						jScrollPane1.setBounds(25, 80, 386, 156);
						{
							tblIngredientes = new JTable();
							jScrollPane1.setViewportView(tblIngredientes);
							tblIngredientes.setBounds(49, 53, 288, 113);
						}
					}
					{
						btSalir = new JButton();
						pnlListadoIngredientes.add(btSalir);
						btSalir.setText("Salir");
						btSalir.setBounds(325, 258, 76, 28);
					}
				}
			}
			this.setSize(444, 351);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public JTable getTblIngredientes() {
		return tblIngredientes;
	}

	public JRadioButton getRbAscendente() {
		return rbAscendente;
	}
	
	public JRadioButton getRbDescendente() {
		return rbDescendente;
	}

	public JButton getBtSalir() {
		return btSalir;
	}
	
	private ButtonGroup getButtonGroup1() {
		if(buttonGroup1 == null) {
			buttonGroup1 = new ButtonGroup();
		}
		return buttonGroup1;
	}
}
